package com.uzai.console.web.pyq;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.pyq.llygoods.PyqLlyGoodsJobBatchSendDao;
import com.uzai.console.dto.pyq.llygoods.PyqLlyGoodsJobSendDao;
import com.uzai.console.dto.pyq.llygoods.PyqLlyGoodsQuery;
import com.uzai.console.service.feign.UzaiBusinessFeignService;
import com.uzai.console.service.lly.LlyGoodsService;
import com.uzai.console.service.pyq.PyqLlyGoodsService;
import com.uzai.console.vo.pyq.llygoods.PyqLlyGoodsVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 朋友圈悠哉精选拼多多商品列表
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "悠哉精选(拼多多)商品列表",tags = "个人微信|朋友圈|悠哉精选(拼多多)商品列表")
@ApiSort(31)
@RestController
public class PyqYzjxPddGoodsController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(PyqYzjxPddGoodsController.class);

    @Autowired
    private PyqLlyGoodsService pyqLlyGoodsService;
    @Autowired
    private LlyGoodsService llyGoodsService;
    @Autowired
    private UzaiBusinessFeignService uzaiBusinessFeignService;

    @ApiOperation(value = "分页查询悠哉精选(拼多多)商品列表", notes = "分页查询悠哉精选(拼多多)商品列表", response = PyqLlyGoodsVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/PyqYzjxPddGoods/findPyqLlyGoodsList")
    public Object findPyqYzjxPddGoodsList(@RequestBody PyqLlyGoodsQuery pyqLlyGoodsQuery){
        //pyqLlyGoodsQuery.setSize(40);//默认查询40条
        pyqLlyGoodsQuery.setPlatform(1); //悠哉精选拼多多商品
        return pyqLlyGoodsService.findPyqLlyGoodsList(pyqLlyGoodsQuery);
    }

    @ApiOperation(value = "批量悠哉精选(拼多多)商品发送朋友圈任务", notes = "批量悠哉精选拼多多商品发送朋友圈任务")
    @ApiOperationSupport(order = 2)
    @PostMapping("/PyqYzjxPddGoods/batchSendPyqJpb")
    public Object batchSendPyqJpb(@RequestBody PyqLlyGoodsJobBatchSendDao pyqLlyGoodsJobBatchSendDao){
        pyqLlyGoodsJobBatchSendDao.setPlatform(2); //后台平台拼多多平台
        pyqLlyGoodsJobBatchSendDao.setType(3);   //悠哉精品库拼多多商品
         pyqLlyGoodsService.batchSendPyqJpb(pyqLlyGoodsJobBatchSendDao);
        return true;
    }

    @ApiOperation(value = "单个悠哉精选(拼多多)商品发送朋友圈任务", notes = "单个悠哉精选(拼多多)商品发送朋友圈任务")
    @ApiOperationSupport(order = 3)
    @PostMapping("/PyqYzjxPddGoods/sendPyqJpb")
    public Object sendPyqJpb(@RequestBody PyqLlyGoodsJobSendDao pyqLlyGoodsJobSendDao){
        pyqLlyGoodsJobSendDao.setPlatform(2); //后台平台拼多多平台
        pyqLlyGoodsJobSendDao.setType(3);     //悠哉精品库拼多多商品
        pyqLlyGoodsService.sendPyqJpb(pyqLlyGoodsJobSendDao);
        return true;
    }

}
